package com.xiaoqi.api.utlis;

public class ThreadContextUtil {
    //作用:就是给当前线程绑定数据的
    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    private static ThreadLocal<String> threadLocalName = new ThreadLocal<>();

    public static void setData(Integer data){
        threadLocal.set(data);
    }

    public static Integer getData(){
        return threadLocal.get();
    }
    public static void removeData(){
        threadLocal.remove();
    }
    public static void setDataName(String data){
        threadLocalName.set(data);
    }
    public static String getDataName(){
        return threadLocalName.get();
    }
    public static void removeDataName(){
        threadLocalName.remove();
    }
}
